<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class ProductsFieldAddOne extends AbstractMigration
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change(): void
    {
        $table = $this->table('ctmon_products');
        $table->addColumn('page_id', 'integer', ['limit' => 10, 'comment' => "页面id", 'default' => 0, 'signed' => false])
            ->addColumn('delete_time', 'integer', ['limit' => 11, 'signed' => false, 'default' => 0, 'comment' => "删除时间"])
            ->addColumn('create_time', 'integer', ['limit' => 11, 'signed' => false, 'comment' => "创建时间"])
            ->addColumn('update_time', 'integer', ['limit' => 11, 'signed' => false, 'comment' => "更新时间"])
            ->addColumn('ver', 'biginteger', ['limit' => 20, 'signed' => false, 'default' => 0, 'comment' => "在校时长"])
            ->changeComment('产品表||@page_id@delete_time@create_time@update_time@ver')
            ->update();
    }
}
